package com.xs.ahoi.hcxs.utils;

import java.io.FileFilter;
import java.util.regex.Pattern;

/**
 * 正则表达式常量
 *
 * @author fuhuichao
 * @date 2020-01-17 10:51
 */
public class RegexConstants {

    public static Pattern zipPattern = Pattern.compile("\\.(7z|zip|rar)$");

    public static Pattern filePattern = Pattern.compile("\\.(7z|zip|rar|txt|log)$");
    /**
     * 只搜索文件夹、txt、log、压缩文件
     */
    public static FileFilter fileSearchFilter = file -> {
        String name = file.getName().toLowerCase();
        return file.isDirectory() || filePattern.matcher(name).find();
    };
}
